import got from 'got'

const Authorization = 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjo2MTYwNDcwLCJyZWdpc3Rlcl90eXBlIjoicGhvbmUiLCJhcHBfbmFtZSI6IkNoaXRDaGF0X1dlYiIsInRva2VuX2lkIjoiOWE2MmM2ODYtYjkyMS00Zjk0LWJkMzUtOTQyOWU3YTNhNGJlIiwiaXNzIjoic2lkZXIuYWkiLCJhdWQiOlsiIl0sImV4cCI6MTczMjY5MTg0OCwibmJmIjoxNzAxNTg3ODQ4LCJpYXQiOjE3MDE1ODc4NDh9.Y7rHkMStuTeKFuTIXJxqUmR7IiNYv4OO_24zwpjZ6-s'
const path = 'https://sider.ai/api/v1/completion/text'
const conversationId = ''

const promptGpt = async (prompt: String) => {
    const option = {
        headers: { Authorization },
        json: {
            prompt,
            stream: true,
            app_name: 'ChitChat_Chrome_Ext',
            app_version: '3.6.0',
            tz_name: 'Asia/Shanghai',
            cid: '',
            model: 'gpt-3.5',
            search: false,
            auto_search: false,
            filter_search_history: false,
            from: 'chat',
            chat_models: []
        }
    }
    const data = await got.post(path, option)
    console.log('%c [ data ]-9', 'font-size:13px; background:pink; color:#bf2c9f;', data)
}

export default promptGpt